<?php get_instance()->view('common/header');?>

<style type="text/css">
    <!--
    .text-val {
        padding-top: 3px;
        padding-left: 0;
    }

    .text-label {
        color: grey;
        text-align: right;
    }

    .btn-group, .btn-group-vertical {
        display: inline-block;
        position: absolute;
        vertical-align: middle;
    }

    .sale-summary li:first-child {
        border-top: medium none;
    }

    .sale-summary li {
        border-top: 1px solid #eee;
        overflow: hidden;
        padding: 10px 0;
    }

    .sale-summary li .sale-info {
        color: #646464;
        float: left;
        font-size: 14px;
        text-transform: uppercase;
    }

    .sale-summary li .sale-num {
        color: #169ef4;
        float: right;
        font-size: 20px;
        font-weight: 300;
    }

    .description-box img {
        width: 100%;
    }
    -->
</style>

<style type="text/css">
    div .radio-inline:nth-child(2), div .checkbox-inline:nth-child(2) {
        margin-left: 10px;
    }
    div.form-body>.tab-pane{display: none}
    div.form-body>.tab-pane.active{display: block}

    .table-scrollable > .table > thead > tr > th, .table-scrollable > .table > tbody > tr > th, .table-scrollable > .table > tfoot > tr > th, .table-scrollable > .table > thead > tr > td, .table-scrollable > .table > tbody > tr > td, .table-scrollable > .table > tfoot > tr > td{
        word-break:break-all;
    }
    
    .sale-summary li {
	    border-top: 1px solid #eee;
	    overflow: hidden;
	    padding: 5px 0;
	}
    
</style>
<div class="page-container home">
    <?php get_instance()->view('common/sidebar');?>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12">
                    <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                    <h3 class="page-title">配送员详情</h3>
                    <ul class="page-breadcrumb breadcrumb">
                        <li class="btn-group"> <a class="btn default ml_5 return" href="<?php echo getUrl('deliveryman/member');?>"><i class="fa fa-chevron-left"></i> 返回</a> </li>
                        <li> <i class="fa fa-home"></i> <a href="<?php echo getUrl('home');?>"> 首页  <i class="fa fa-angle-right"></i> </a></li>
                        <li><a href="<?php echo getUrl('deliveryman/member');?>">配送员列表  <i class="fa fa-angle-right"></i></a></li>
                        <li><a href="javascript:void(0);">配送员详情</a></li>
                    </ul>
                    <!-- END PAGE TITLE & BREADCRUMB-->
                </div>
            </div>


            <div class="row">
                <div class="col-md-12">
                    <div class="row">
                        <div class="col-md-12 profile-info">
                            <div class="row">
                                <div class="col-md-12">
                                    <div style="border: 1px solid #ddd; padding: 10px; margin-bottom: 30px;">
                                        <div class="row">
                                        <div class="col-md-2">
							                    <ul class="list-unstyled profile-nav">
							                        <li><img src="<?php if($portrait){echo $portrait;}else{echo $this->staticUrl.'/img/no_img_100.jpg';}?>" class="img-responsive" alt=""></li>
							                    </ul>
							                </div>
                                            <div class="col-md-7">
                                                <div class="row">
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">姓名：</label>
                                                            <div class="col-md-8 text-val"><?php echo $name;?></div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">类型：</label>
                                                            <div class="col-md-8 text-val"><?php echo $type;?></div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">身份证号码：</label>
                                                            <div class="col-md-8 text-val"><?php echo $identity_card;?></div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">电话：</label>
                                                            <div class="col-md-8 text-val">
                                                            	<?php echo $mobile;?>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">注册时间：</label>
                                                            <div class="col-md-8 text-val"><?php echo dateFormat($addtime);?></div>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">状态：</label>
                                                            <div class="col-md-8 text-val"><?php echo $status_str;?></div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">区域态：</label>
                                                            <div class="col-md-8 text-val"><?php echo $province.($province == $city ? '' : $city).$county;?></div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-3">
												<div class="portlet sale-summary">
													<div class="portlet-body">
														<ul class="list-unstyled">
															<li>
																<span class="sale-info">
																	余额
																</span>
																<span class="sale-num">
																	 <?php echo $amount ? $amount : 0;?>
																</span>
															</li>
															<li>
																<span class="sale-info">
																	 接单数
																</span>
																<span class="sale-num">
																	 <?php echo (int)$order_total;?>
																</span>
															</li>
															<li>
																<span class="sale-info">
																	 完成数量
																</span>
																<span class="sale-num">
																	<?php echo (int)$order_complete_total;?>
																</span>
															</li>
															<li>
																<span class="sale-info">
																	完成超时
																</span>
																<span class="sale-num">
																	 <?php echo (int)$order_overtime_total;?>
																</span>
															</li>
														</ul>
													</div>
												</div>
											</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--end row-->
                    <div class="tabbable tabbable-custom tabbable-custom-profile">
                        <ul class="nav nav-tabs">
                            <li class="active"><a href="#tab_1_22" data-toggle="tab"> 位置 </a></li>
                            <li><a href="#tab_1_23" data-toggle="tab"> 运单 </a></li>
                            <li><a href="#tab_1_24" data-toggle="tab"> 收益日志  </a></li>
                            <li><a href="#tab_1_26" data-toggle="tab"> 身份证照片</a></li>
                        </ul>
                        <div class="tab-content">
                            <div class="tab-pane active" id="tab_1_22">
                                <div style="padding: 10px;width: 100%;" class="description-box">
                                	<?php if( ! $longitude):?>
                                		<div style="width:100%;height:400px;padding-top:180px;text-align:center;font-size:18px;color:grey;">
                                			暂无地址信息！
                                		</div>
                                	<?php endif;?>
                                	<?php if($longitude):?>
                                	<div id="allmap" style="width:100%;height:400px;"></div>
                                	<script type="text/javascript">
                                		var map = null;
                                		$(function(){
											map = new BMap.Map("allmap");           
											map.centerAndZoom(new BMap.Point(<?php echo $longitude;?>, <?php echo $latitude;?>), 19);
											map.enableScrollWheelZoom(true);
											change();
                                    	});

                                		var i = 0;
                                		function change(){
									 		$.ajax({
										 			url:"<?php echo getUrl('deliveryman/member/postion?id='.$id);?>",
										 			dataType:'json',
										 			success:function(data){
														if(data.length){
															map.clearOverlays();
															var pt = new BMap.Point(data[0], data[1]);
															var myIcon = new BMap.Icon("<?php echo base_url('static/img/courier.png');?>", new BMap.Size(50,50));
															var marker2 = new BMap.Marker(pt, {icon:myIcon});  // 创建标注
															map.addOverlay(marker2); 
															map.panTo(pt);
														}
											 		}
										 	});
											
										 	setTimeout('change();', 5000);
									 	}

                                		function addMarker(point){
                                			  var marker = new BMap.Marker(point);
                                			  map.addOverlay(marker);
                                		}
									 	
									</script>
									<?php endif;?>
                                </div>
                            </div>
                            <!--tab-pane-->
                            <!--<div class="tab-pane" id="tab_1_22">
                                <div class="tab-pane active" id="tab_1_1_1">
                                    <div style="width: 500px; padding: 10px;" class="description-box">
                                    </div>
                                </div>
                            </div>-->
                            <!--tab-pane-->
                            <div class="tab-pane" id="tab_1_23">
                                <div style="padding: 10px;width: 100%;">
									<div class="table-container">
						                <div class="table-actions-wrapper"> <span> </span>
					                    </div>
						                <table class="table table-bordered table-hover scoll-title" id="datatable">
						                  <thead>
						                    <tr role="row" class="heading">
						                      <th width="10%">下单日期</th>
						                      <th width="8%">运单编号</th>
						                      <th width="10%">门店名称</th>
						                      <th width="6%">下单人</th>
						                      <th width="10%">取货地址</th>
											  <th width="10%">收货地址</th>
											  <th width="5%">配送距离</th>
											  <th width="5%">配送费</th>
											  <th width="6%">类型</th>
						                      <th width="10%">时间状态</th>
						                      <th width="7%">异常报备</th>
						                      <th width="6%">状态</th>
						                      <th width="8%">操作</th>
						                    </tr>
						                    <tr>
												<th>
													<div class="margin-bottom-5">
														<input dp class="form-control form-filter input-sm" name="date_from" placeholder="从" type="text">
													</div>
													<input dp class="form-control form-filter input-sm" name="date_to" placeholder="到" type="text">
												</th>
												<th>
													<input class="form-control form-filter input-sm" name="code" type="text">
												</th>
												<th>
												  <div class="margin-bottom-5">
													<input class="form-control form-filter input-sm" name="send_user" type="text" placeholder="店铺名称">
												  </div>
												  <input class="form-control form-filter input-sm" name="send_mobile" type="text" placeholder="联系电话">
												</th>
												<th>
												  <div class="margin-bottom-5">
													<input class="form-control form-filter input-sm" name="send_mobile" type="text" placeholder="名称">
												  </div>
												  <input class="form-control form-filter input-sm" name="send_to_mobile" type="text" placeholder="联系电话">
												</th>
												<th><input class="form-control form-filter input-sm" name="send_address" type="text"></th>
												<th><input class="form-control form-filter input-sm" name="send_to_address" type="text"></th>
												<th></th>
												<th></th>
												<th>
							                      	<select name="ap_status" class="form-control form-filter input-sm">
														<option value="">所有</option>
														<?php foreach ($apconfig as $k => $v):?>
														<option value="<?php echo $k;?>"><?php echo $v;?></option>
														<?php endforeach;?>
													</select>
							                     </th>
												<th>
													<select name="type" class="form-control form-filter input-sm">
													<option value="" selected="selected">所有</option>
													<?php foreach ($type as $k => $v):?>
													<option value="<?php echo $k;?>"><?php echo $v;?></option>
													<?php endforeach;?>
												</select>
												</th>
												<th></th>
						                      <th>
						                      	<select name="status" class="form-control form-filter input-sm">
													<option value="">所有</option>
													<?php foreach ($status as $k => $v): if($v == 1) continue;?>
													<option value="<?php echo $k;?>"><?php echo $v;?></option>
													<?php endforeach;?>
												</select>
						                      </th>
						                      <th> <div class="btn-group">
												<a class="btn btn-xs filter-submit btn-default">
													<i class="fa fa-search"></i> 搜索
												</a>
												<button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
												<ul role="menu" class="dropdown-menu pull-right">
													<li>
														<a href="javascript:void(0);" class="filter-cancel">重置</a>
													</li>
												</ul>
											</div></th>
						                    </tr>
						                  </thead>
						                  <tbody>
						                  </tbody>
						                </table>
						              </div>
						              <script type="text/javascript">
										$(function(){
											datatable_init({
												src: $("#datatable"),
												sAjaxSource: "<?php echo getUrl('deliveryman/member/getOrderList?id='.$id);?>",
												"bProcessing": false,
									            bSort:false,
											});	
										});
						              </script>	
                                </div>
                            </div>
                            <!--tab-pane-->
                            <div class="tab-pane" id="tab_1_24">
                                <div style="padding: 10px;width: 100%;">
									<div class="table-container">
						                <div class="table-actions-wrapper"> <span> </span>
					                    </div>
						                <table class="table table-bordered table-hover scoll-title" id="datatable1">
						                  <thead>
						                    <tr role="row" class="heading">
						                      <th width="25%">日期</th>
						                      <th width="25%">类型</th>
						                      <th width="25%">金额</th>
						                      <th width="15%">状态</th>
						                      <th width="10%">操作</th>
						                    </tr>
						                    <tr>
												<th>
													<div class="margin-bottom-5">
														<input dp class="form-control form-filter input-sm" name="date_from" placeholder="从" type="text">
													</div>
													<input dp class="form-control form-filter input-sm" name="date_to" placeholder="到" type="text">
												</th>
												<th>
													<select name="type" class="form-control form-filter input-sm">
														<option value="">所有</option>
														<?php foreach ($amount_type as $k => $v):?>
														<option value="<?php echo $k;?>"><?php echo $v;?></option>
														<?php endforeach;?>
													</select>
												</th>
						                      <th>
						                      	<select name="status" class="form-control form-filter input-sm">
														<option value="">所有</option>
														<?php foreach ($amount_status as $k => $v):?>
														<option value="<?php echo $k;?>"><?php echo $v;?></option>
														<?php endforeach;?>
													</select>
						                      </th>
						                      <th></th>
						                      <th> <div class="btn-group">
												<a class="btn btn-xs filter-submit btn-default">
													<i class="fa fa-search"></i> 搜索
												</a>
												<button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
												<ul role="menu" class="dropdown-menu pull-right">
													<li>
														<a href="javascript:void(0);" class="filter-cancel">重置</a>
													</li>
												</ul>
											</div></th>
						                    </tr>
						                  </thead>
						                  <tbody>
						                  </tbody>
						                </table>
						              </div>
						              <script type="text/javascript">
										$(function(){
											datatable_init({
												src: $("#datatable1"),
												sAjaxSource: "<?php echo getUrl('deliveryman/member/getAmountList?id='.$id);?>",
												"bProcessing": false,
									            bSort:false,
											});

											$('[dp]').not("[noinit]").datepicker({
									            changeMonth: true,
									            autoclose: true,
									            format: "yyyy-mm-dd",
									            language: 'zh-CN'
									        });	
										});
						              </script>	
                                </div>
                            </div>
                            <!--tab-pane-->
                            <div class="tab-pane" id="tab_1_26">
                                <img alt="" src="<?php echo $identity_card_img;?>" style="max-width:400px;">
                            </div>
                            <!--tab-pane-->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=<?php echo $ak;?>"></script>
</body>
</html>